##SN=440125339
#SN=440185732
####SN=440056238
SN=440249840
#SN=440252510
##SN=440097847
##SN=440185941
##SN=440097854
################################################
#  source flash_hex.sh    HUB_DEVICE  440252510       #使用Jlink 440252510烧录HUB_DEVICE工程
#  source flash_hex.sh     #使用默认SN Jlink烧录RFM_DEVICE工程
#
#
################################################


if [ ! -n "$1" ]; then
	PROJECT=../RFM_DEVICE/RFM_DEVICE.hex
	echo "Project file:" $PROJECT

else
	PROJECT=../$1/$1.hex
	echo "Project File:" $PROJECT
fi




if [ ! -n "$2" ]; then
	echo  "Jlink Use default:"$SN
else
	SN=$2
	echo "Jlink  use:"$SN
fi

DEVICE_CHIP=EFR32ZG23B020F512IM48




#reset
commander.exe  device reset  --device $DEVICE_CHIP  -s $SN
#commander.exe  device recover --device $DEVICE_CHIP -s $SN

commander.exe  flash $PROJECT --device $DEVICE_CHIP  -s $SN

commander.exe  device reset --device $DEVICE_CHIP  -s $SN




